package top.codedance.iotp.simulator.serialPort.srs.gld;

import top.codedance.iotp.common.util.BytesBuilder;
import top.codedance.iotp.common.util.HexCodec;
import top.codedance.iotp.simulator.serialPort.srs.Simulator;

import java.util.ArrayList;
import java.util.List;

/**
 * 测漏检测仪模拟器
 * 品牌：优必得
 * 型号：KP315AU
 * @Description
 * @author ChenPeng
 * @date 2023/4/12 22:09
 */
public class YouBiDe implements Simulator {
    @Override
    public List<BytesBuilder> exec(byte[] cmd) {
        List<BytesBuilder> results = new ArrayList<>();
        HexCodec hc = new HexCodec();
        String command = hc.toHex(cmd).replaceAll("\\s+", "").toUpperCase();
        String head = command.substring(0, 2);
        if(head.equals("05") && command.substring(2, 4).equals("75")) {
            BytesBuilder bb = new BytesBuilder();
            bb.append("06 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 00 00 01 B0 00 00 40 00 12 00 01 B0 00 00 20 00 12 02 01 B0 00 00 20 00 12 02 06 B0 00 00 20 00 12 02 06 0C 00 00 20 00 12 02 06 0C 23 00 20 04 12 02 06 0C 23 07 04 05 12 02 06 0C 23 07 04 06 12 02 06 0C 23 07 04 07 12 02 06 0C 23 07 04 08 12 02 06 0C 23 0F 04 09 12 02 06 0C 23 10 04 0A 12 02 06 0C 23 12 04 0B 12 02 06 0C 23 13 04 0C 12 02 06 0C 23 14 04 0D 12 02 06 0C 23 15 04 0E 12 02 06 0C 23 17 04 0F 12 02 06 0C 23 18 04 00 12 02 06 0C 23 1C 04 01 12 02 06 0C 23 1D 04 02 12 02 06 0C 23 1E 04 03 12 02 06 0C 23 20 04 04 12 02 06 0C 23 21 04 05 12 02 06 0C 23 22 04 06 12 02 06 0C 23 23 04 07 12 02 06 0C 23 25 04 00 12 03 1E 0D 3A 33 40 00 12 03 1E 0D 3B 1D 40 00 12 03 1E 0E 00 09 40 00 12 03 1E 0E 00 0C 40 00 12 03 1E 0E 35 0F 40 01 12 03 1E 0E 35 0F 04 02 12 03 1E 0E 35 0F 04 03 12 03 1E 0E 35 0F 04 04 12 03 1E 0E 35 0F 04 05 12 03 1E 0E 35 0F 04 06 12 03 1E 0E 35 0F 04 07 12 03 1E 0E 35 0F 04 00 13 03 15 0C 18 26 40 00 13 03 15 0C 18 26 04 00 13 03 15 0C 19 06 40 00 13 03 15 0C 19 06 04 00 13 03 15 0C 1C 15 40 00 13 03 15 0C 25 28 40 00 13 03 15 0C 38 04 40 00 13 03 15 0C 3B 1D 40 00 13 03 15 0D 00 3A 40 00 13 03 1F 10 16 3A 40 00 13 04 01 10 11 0D 40 00 13 04 02 0F 01 10 40 00 13 04 03 10 0E 09 40 00 13 04 09 09 2B 15 40 00 13 04 11 07 29 29 40 00 13 04 1A 0E 1E 17 40 02 13 04 1A 0E 1E 17 04 00 13 04 1A 0E 25 22 40 00 13 05 09 0C 08 0F 40 00 13 05 11 08 1D 01 40 00 13 06 0F 07 1A 08 40 00 13 06 0F 08 00 24 40 00 13 07 06 01 24 14 40 00 13 07 1D 08 2E 39 40 00 13 09 0A 06 14 2A 40 00 14 01 0E 0D 27 06 40 00 14 05 1C 07 13 30 40 00 14 07 09 05 2C 35 40 02 14 07 1B 0F 18 18 04 00 14 07 1B 10 00 0D 40 02 14 07 1B 10 00 0D 04 00 14 07 1B 10 00 3A 40 02 14 07 1B 10 00 3A 04 00 14 07 1B 10 01 3A 40 02 14 07 1B 10 01 3A 04 00 14 07 1B 10 08 06 40 02 14 07 1B 10 08 06 04 00 14 07 1B 11 1C 27 40 03 14 08 07 11 01 3B 04 00 14 08 07 12 2A 29 40 00 14 08 0B 17 34 20 40 00 14 08 13 0F 20 06 40 02 15 02 03 09 1C 27 04 00 15 02 03 0A 0B 2D 40 00 15 03 11 07 06 0A 40 00 15 04 01 09 01 01 40 00 15 04 16 10 28 36 40 00 15 06 17 09 03 29 40 00 15 06 18 09 2E 2C 40 00 15 08 0D 08 20 30 40 00 15 08 0D 08 22 29 40 00 15 0A 0F 0A 0B 0A 40 00 15 0A 11 16 06 16 40 00 15 0A 1E 0A 26 29 40 00 15 0B 01 08 0E 2B 40 05 15 0B 03 09 2A 32 04 00 15 0B 04 07 36 1F 40 05 16 05 19 09 0B 25 04 00 16 05 19 10 32 14 40 00 16 06 05 11 11 03 40 00 16 06 13 11 2F 2D 40 00 16 08 13 0A 15 2D 40 03 16 08 16 0D 2D 3A 04 00 16 08 16 11 3B 0B 40 00 16 09 14 11 09 1A 40 00 16 0A 14 0F 1A 2B 40 00 16 0A 14 0F 1B 18 40 00 16 0A 14 0F 1F 14 40 00 16 0A 14 0F 1F 1B 40 00 16 0A 14 0F 1F 35 40 00 16 0A 14 0F 31 24 40 00 16 0A 15 08 27 15 40 00 16 0A 1F 0A 39 05 40 00 16 0B 0D 0C 2A 11 40 00 17 04 1A 0E 0C 21 40 00 17 04 1A 0E 31 1D 40 00 17 04 1A 0F 03 05 10 00 17 04 1A 0F 03 0B 10 00 17 04 1A 0F 03 11 10 00 17 04 1A 0F 04 2F 10 00 17 04 1A 0F 06 2A 10 00 17 04 1A 0F 0C 39 10 00 17 04 1A 0F 12 2A 10 00 17 04 1A 0F 15 20 10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF".replaceAll(" ","").getBytes());
            results.add(bb);
            BytesBuilder bb1 = new BytesBuilder();
            bb1.append("FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF".replaceAll(" ", "" ).getBytes());
            results.add(bb1);

            BytesBuilder bb2 = new BytesBuilder();
            bb2.append("FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF".replaceAll(" ", "" ).getBytes());
            results.add(bb2);

            BytesBuilder bb3 = new BytesBuilder();
            bb3.append("FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF".replaceAll(" ", "" ).getBytes());
            results.add(bb3);

            BytesBuilder bb4 = new BytesBuilder();
            bb4.append("FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF".replaceAll(" ", "" ).getBytes());
            results.add(bb4);
            return results;
        }else{
            return results;
        }
    }
}
